package utils;

import java.util.ArrayList;

import file.*;

public class Statistics {

	public static void leechPercentage(ArrayList<File> leech){
		File file;
		BufferMap bufferMap;
		for(int i = 0; i < leech.size() ; i++){
			file = leech.get(i);
			bufferMap = file.getBufferMap();
			double percentage = (bufferMap.getBufferMap().cardinality() / bufferMap.getLength())*100;	

			System.out.println(file.getName() + " : " + percentage + "% downloaded");
		}
	}


	public static void listConnectedPeers(ArrayList<String> connectedToMe, ArrayList<String> imConnectedTo){
		System.out.println("Peers auxquels je suis connecté :");
		for(String s : imConnectedTo){
			System.out.println(s);
		}
		System.out.println("Peers qui sont connecté à moi :");
		for(String s : connectedToMe){
			System.out.println(s);
		}
	}
}





